Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

chore: converts remaining files api to async iterators #1124

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

achingbrain
Copy link
Collaborator

No description provided.

Copy link
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some tidbits.

const promisify = require('promisify-es6')
const configure = require('../lib/configure')
const tarStreamToObjects = require('../utils/tar-stream-to-objects')
const IsIpfs = require('is-ipfs')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const IsIpfs = require('is-ipfs')
const isIpfs = require('is-ipfs')

Reserve Capital for Constructors

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's my Java showing but this looks natural to me 🤣

Isn't this the sort of thing we have a linter for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wanna add that rule?


try {
path = cleanCID(path)
} catch (err) {
if (!v.ipfsPath(path)) {
return callback(err)
if (!IsIpfs.ipfsPath(path)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!IsIpfs.ipfsPath(path)) {
if (!isIpfs.ipfsPath(path)) {

@@ -1,64 +1,72 @@
'use strict'

const promisify = require('promisify-es6')
const IsIpfs = require('is-ipfs')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const IsIpfs = require('is-ipfs')
const isIpfs = require('is-ipfs')

} catch (err) {
if (!IsIpfs.ipfsPath(args)) {
return callback(err)
if (!IsIpfs.ipfsPath(path)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!IsIpfs.ipfsPath(path)) {
if (!isIpfs.ipfsPath(path)) {

const cleanCID = require('../utils/clean-cid')
const IsIpfs = require('is-ipfs')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const IsIpfs = require('is-ipfs')
const isIpfs = require('is-ipfs')

@achingbrain
Copy link
Collaborator Author

I'm going to merge this to unblock ipfs/js-ipfs#2517 - have opened ipfs/aegir#449 to discuss the capitalisation thing further.

The lines of code in question were pre-existing in the codebase, so let's not widen the scope of this PR.

Happy to open another for general improvements if we decide it's a good idea.

@achingbrain achingbrain merged commit d087b72 into master Oct 15, 2019
@achingbrain achingbrain deleted the add-async-iterator-methods branch October 15, 2019 11:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants